$gwx_XC_15=function(_,_v,_n,_p,_s,_wp,_wl,$gwn,$gwl,$gwh,wh,$gstack,$gwrt,gra,grb,TestTest,wfor,_ca,_da,_r,_rz,_o,_oz,_1,_1z,_2,_2z,_m,_mz,nv_getDate,nv_getRegExp,nv_console,nv_parseInt,nv_parseFloat,nv_isNaN,nv_isFinite,nv_decodeURI,nv_decodeURIComponent,nv_encodeURI,nv_encodeURIComponent,$gdc,nv_JSON,_af,_gv,_ai,_grp,_gd,_gapi,$ixc,_ic,_w,_ev,_tsd){return function(path,global){
if(typeof global==='undefined'){if (typeof __GWX_GLOBAL__==='undefined')global={};else global=__GWX_GLOBAL__;}if(typeof __WXML_GLOBAL__ === 'undefined') {__WXML_GLOBAL__={};
}__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};
var e_={}
if(typeof(global.entrys)==='undefined')global.entrys={};e_=global.entrys;
var d_={}
if(typeof(global.defines)==='undefined')global.defines={};d_=global.defines;
var f_={}
if(typeof(global.modules)==='undefined')global.modules={};f_=global.modules || {};
var p_={}
__WXML_GLOBAL__.ops_cached = __WXML_GLOBAL__.ops_cached || {}
__WXML_GLOBAL__.ops_set = __WXML_GLOBAL__.ops_set || {};
__WXML_GLOBAL__.ops_init = __WXML_GLOBAL__.ops_init || {};
var z=__WXML_GLOBAL__.ops_set.$gwx_XC_15 || [];
function gz$gwx_XC_15_1(){
if( __WXML_GLOBAL__.ops_cached.$gwx_XC_15_1)return __WXML_GLOBAL__.ops_cached.$gwx_XC_15_1
__WXML_GLOBAL__.ops_cached.$gwx_XC_15_1=[];
(function(z){var a=11;function Z(ops){z.push(ops)}
Z([[7],[3,'isLoading']])
Z([[2,'!'],[[7],[3,'isLoading']]])
Z([3,'bg-gradual'])
Z([1,true])
Z([3,'price_wrap'])
Z([[2,'=='],[[6],[[7],[3,'goodDetail']],[3,'is_part']],[1,0]])
Z([[2,'&&'],[[2,'=='],[[6],[[7],[3,'goodDetail']],[3,'is_part']],[1,1]],[[2,'=='],[[6],[[7],[3,'rule_info']],[3,'two_order']],[1,1]]])
Z([[2,'&&'],[[2,'=='],[[6],[[7],[3,'goodDetail']],[3,'is_part']],[1,1]],[[2,'=='],[[6],[[7],[3,'rule_info']],[3,'two_order']],[1,2]]])
Z([[7],[3,'commentLists']])
Z([3,'index'])
Z([3,'#FA7B14'])
Z([[6],[[7],[3,'item']],[3,'score']])
Z([1,5])
Z([[8],'wxParseData',[[6],[[7],[3,'article']],[3,'nodes']]])
Z([3,'wxParse'])
})(__WXML_GLOBAL__.ops_cached.$gwx_XC_15_1);return __WXML_GLOBAL__.ops_cached.$gwx_XC_15_1
}
__WXML_GLOBAL__.ops_set.$gwx_XC_15=z;
__WXML_GLOBAL__.ops_init.$gwx_XC_15=true;
var x=['./pages/bleGoodsDetail/bleGoodsDetail.wxml','../../wxParse/wxParse.wxml'];d_[x[0]]={}
var m0=function(e,s,r,gg){
var z=gz$gwx_XC_15_1()
var c3B=e_[x[0]].i
_ai(c3B,x[1],e_,x[0],1,1)
var l5B=_n('page-loading')
_rz(z,l5B,'loading',0,e,s,gg)
_(r,l5B)
var o4B=_v()
_(r,o4B)
if(_oz(z,1,e,s,gg)){o4B.wxVkey=1
var a6B=_mz(z,'cu-custom',['bgColor',2,'isBack',1],[],e,s,gg)
_(o4B,a6B)
var t7B=_n('view')
_rz(z,t7B,'class',4,e,s,gg)
var e8B=_v()
_(t7B,e8B)
if(_oz(z,5,e,s,gg)){e8B.wxVkey=1
}
var b9B=_v()
_(t7B,b9B)
if(_oz(z,6,e,s,gg)){b9B.wxVkey=1
}
var o0B=_v()
_(t7B,o0B)
if(_oz(z,7,e,s,gg)){o0B.wxVkey=1
}
e8B.wxXCkey=1
b9B.wxXCkey=1
o0B.wxXCkey=1
_(o4B,t7B)
var xAC=_v()
_(o4B,xAC)
var oBC=function(cDC,fCC,hEC,gg){
var cGC=_mz(z,'tui-rate',['active',10,'current',1,'quantity',2],[],cDC,fCC,gg)
_(hEC,cGC)
return hEC
}
xAC.wxXCkey=4
_2z(z,8,oBC,e,s,gg,xAC,'item','index','index')
var oHC=_v()
_(o4B,oHC)
var lIC=_oz(z,14,e,s,gg)
var aJC=_gd(x[0],lIC,e_,d_)
if(aJC){
var tKC=_1z(z,13,e,s,gg) || {}
var cur_globalf=gg.f
oHC.wxXCkey=3
aJC(tKC,tKC,oHC,gg)
gg.f=cur_globalf
}
else _w(lIC,x[0],3,3897)
}
o4B.wxXCkey=1
o4B.wxXCkey=3
c3B.pop()
return r
}
e_[x[0]]=e_[x[0]]||{f:m0,j:[],i:[],ti:[x[1]],ic:[]}
if(path&&e_[path]){
return function(env,dd,global){$gwxc=0;var root={"tag":"wx-page"};root.children=[]
;g="$gwx_XC_15";var main=e_[path].f
if (typeof global==="undefined")global={};global.f=$gdc(f_[path],"",1);
try{
main(env,{},root,global);
_tsd(root)
}catch(err){
console.log(err)
}
;g="";
return root;
}
}
}
}(__g.a,__g.b,__g.c,__g.d,__g.e,__g.f,__g.g,__g.h,__g.i,__g.j,__g.k,__g.l,__g.m,__g.n,__g.o,__g.p,__g.q,__g.r,__g.s,__g.t,__g.u,__g.v,__g.w,__g.x,__g.y,__g.z,__g.A,__g.B,__g.C,__g.D,__g.E,__g.F,__g.G,__g.H,__g.I,__g.J,__g.K,__g.L,__g.M,__g.N,__g.O,__g.P,__g.Q,__g.R,__g.S,__g.T,__g.U,__g.V,__g.W,__g.X,__g.Y,__g.Z,__g.aa);if(__vd_version_info__.delayedGwx||false)$gwx_XC_15();	if (__vd_version_info__.delayedGwx) __wxAppCode__['pages/bleGoodsDetail/bleGoodsDetail.wxml'] = [$gwx_XC_15, './pages/bleGoodsDetail/bleGoodsDetail.wxml'];else __wxAppCode__['pages/bleGoodsDetail/bleGoodsDetail.wxml'] = $gwx_XC_15( './pages/bleGoodsDetail/bleGoodsDetail.wxml' );
	;__wxRoute = "pages/bleGoodsDetail/bleGoodsDetail";__wxRouteBegin = true;__wxAppCurrentFile__="pages/bleGoodsDetail/bleGoodsDetail.js";define("pages/bleGoodsDetail/bleGoodsDetail.js",function(require,module,exports,window,document,frames,self,location,navigator,localStorage,history,Caches,screen,alert,confirm,prompt,XMLHttpRequest,WebSocket,Reporter,webkit,WeixinJSCore){
"use strict";var e=require("../../@babel/runtime/helpers/interopRequireDefault"),t=require("../../@babel/runtime/helpers/objectSpread2"),a=e(require("../../@babel/runtime/regenerator")),r=require("../../@babel/runtime/helpers/asyncToGenerator"),n=require("../../request/api"),o=require("../../wxParse/wxParse.js"),i=require("../../utils/util.js"),s="",d=getApp(),c=!1,u=null,l=null;Page({data:{isLoading:!0,navbaner:["商品","分享","详情"],isHiddenHeader:!0,isNavActiveChange:!1,navActive:0,headerNav:0,evaluateTop:0,detailsTop:0,id:null,order_id:null,device_id:null,door_number:null,rule_info:null,goodDetail:null,signflow:!1,time:null,countDown:"",commentLists:null},onLoad:function(e){this.setData({id:e.id,device_id:e.device_id,door_number:e.num,mainboard_type:wx.getStorageSync("mainboard_type")||1}),this.getGoodDetail()},onShow:function(){d.reconnectBlue()},onUnload:function(){clearInterval(u),clearInterval(l)},onPageScroll:function(e){var t=this;this.showImg(e.scrollTop);var a=this.data,r=a.evaluateTop,n=a.detailsTop,o=wx.createSelectorQuery();o.select("#header_nav").boundingClientRect(),o.exec((function(a){var o=Math.ceil(e.scrollTop),i=a[0].height+10;o>=r-i&&o<n-i-2?t.setData({navActive:1}):o>=n-i?t.setData({navActive:2}):o<=100&&t.setData({navActive:0})})),this.setData({isHiddenHeader:e.scrollTop<=100})},navbanerChange:function(e){var t=this,a=this.data,r=a.evaluateTop,n=a.detailsTop,o=e.target.dataset.index;if(this.data.navActive!=o){var i=wx.createSelectorQuery();i.select("#header_nav").boundingClientRect(),i.exec((function(e){var a=0,i=e[0].height+10;1==o?a=r-i:2==o&&(a=n-i),wx.pageScrollTo({scrollTop:a,duration:0}),t.setData({navActive:o})}))}},getTop:function(){var e=this,t=wx.createSelectorQuery();t.select("#good_evaluate").boundingClientRect(),t.select("#good_details_content").boundingClientRect(),t.exec((function(t){e.setData({evaluateTop:t[0].top,detailsTop:t[1].top})}))},showImg:function(e){s||wx.createSelectorQuery().select("#goodsImg").boundingClientRect((function(e){s=e.width})).exec(),o.scrollFun(e,s)},getGoodDetail:function(){var e=this;return r(a.default.mark((function t(){var r,i,s,d,c,u;return a.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.data,i=r.id,s=r.device_id,d=r.door_number,t.next=3,(0,n.getGoodDetail)({id:i,device_id:s,door_number:d});case 3:return c=t.sent,o.wxParse("article","html",c.details,e,5),u=c.rule_info,e.setData({goodDetail:c,rule_info:u,time:1==u.two_order?u.first_effective_time:u.effective_time}),e.countDown(),t.next=10,e.getCommentLists();case 10:e.getTop();case 11:case"end":return t.stop()}}),t)})))()},getCommentLists:function(){var e=this;return r(a.default.mark((function t(){var r,o,i,s,d;return a.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.data.goodDetail,o={product_id:r.id,page:1,row:2},t.next=4,(0,n.getCommentLists)(o);case 4:i=t.sent,s=i.data,(d=i.count)>99999&&(d+="+"),e.setData({commentLists:s,commentListsNum:d,isLoading:!1});case 9:case"end":return t.stop()}}),t)})))()},countDown:function(){var e=this,t=this.data.time;u=setInterval((function(){if(t>=0){var a=Math.floor(t/60/60/24),r=Math.floor(t/60/60%24),n=Math.floor(t/60%60),o=Math.floor(t%60);r=r<10?"0"+r:r,n=n<10?"0"+n:n,o=o<10?"0"+o:o,--t,e.setData({countDown:(a?a+"天":"")+r+":"+n+":"+o})}else e.getGoodDetail(),clearInterval(u)}),1e3)},previewImage:function(e){var t=this.data.commentLists,a=e.currentTarget.dataset,r=a.index,n=a.src,o=t[r].images.map((function(e){return e.resource_url}));console.log(n),wx.previewImage({current:n,urls:o})},getOrderDetial:function(){var e=this,t=this.data,a=t.device_id,r={order_id:t.order_id,time:Math.random()},n=i.encryption(JSON.stringify(r));d.ajax({url:"User/Order/orderDetails",data:{sys_encrypt_data:n},success:function(t){if(1e3==t.data.code){var r=t.data,o=r.data,s=r.sign_data;if(!s)return;var d=JSON.parse(JSON.stringify(s)),c=i.checkSign(o,s,s.sign),u=a==o.device_id,v=n==d.sys_encrypt_data;u&&v&&c&&(clearInterval(l),e.sendOpenCode())}}})},queryOrder:function(){var e=this;l=setInterval((function(){e.getOrderDetial()}),1e3)},buyFun:function(){var e=d.globalData.blue.checkRoot().blueRoot,t=wx.getStorageSync("bluestatus"),a=wx.getStorageSync("connectStatus");t?e||a||!t?!a&&t?d.showToast("蓝牙未连接"):this.confirmOrder():d.showToast("你已关闭了蓝牙,请打开~"):d.showToast("未连接设备")},confirmOrder:function(){var e=this,t=this.data,a=t.id,r=t.device_id,n=t.door_number;c||(c=!0,wx.showLoading({title:"调起支付中...",make:!0}),d.ajax({url:"User/Order/order",data:{id:a,pay_way:1,order_type:1,device_id:r,door_number:n},success:function(t){if(1e3==t.data.code){var a=t.data,r=a.data,n=a.sign_data;e.setData({allMsg:r,order_id:r.order_id});var o=i.checkSign(r,n,n.sign);e.setData({signflow:o}),e.openArking()}else d.showToast(t.data.msg),c=!1}}))},openArking:function(){var e=this,t=this.data.order_id;d.ajax({url:"User/Order/comfirmPay",data:{order_id:t},success:function(t){1e3==t.data.code?e.payByFun():(c=!1,d.showToast(t.data.msg)),wx.hideLoading()}})},payByFun:function(){var e=this.data,a=e.allMsg,r=e.mainboard_type,n=e.signflow;3==r&&n&&(clearInterval(l),this.queryOrder()),d.globalData.isPreviewApi=!0,wx.requestPayment(t(t({},a),{},{success:function(e){c=!1},fail:function(e){clearInterval(l),c=!1,d.showToast("支付失败")}}))},sendOpenCode:function(){var e=this;return r(a.default.mark((function t(){var r,n;return a.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log("下发了sendOpenCode"),r=e.data.door_number,n=d.globalData.blue,wx.getStorageSync("connectStatus")){t.next=7;break}return e.blueJump(0),t.abrupt("return");case 7:return t.next=9,n.send(r);case 9:t.sent?e.blueJump(1):e.blueJump(0);case 11:case"end":return t.stop()}}),t)})))()},blueJump:function(e){var t=this.data,a=t.mainboard_type,r=t.door_number,n=t.goodDetail,o=t.order_id;1==e&&this.bluetoothCallOpenDoor(),wx.redirectTo({url:"../openArking/openArking?o_backs=true&order_id="+o+"&blue_res="+e+"&mainboard_type="+a+"&openBox="+r+"&model="+n.device_model})},bluetoothCallOpenDoor:function(){var e=this.data.order_id;d.ajax({url:"User/Order/bluetoothCallOpenDoor",data:{order_id:e,type:1},success:function(e){}})},skipAllEvaluate:function(){var e=this.data.goodDetail;wx.navigateTo({url:"/pages/comment/commentList/commentList?product_id="+e.id})}});
},{isPage:true,isComponent:true,currentFile:'pages/bleGoodsDetail/bleGoodsDetail.js'});require("pages/bleGoodsDetail/bleGoodsDetail.js");